@extends('admin.layout.main')
@section("content")
    <form class="layui-form" action="/admin/contract/update/{{$contract->id}}" method="post">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>合同修改</legend>
        </fieldset>
        <div class="layui-form-item">
            <label class="layui-form-label">合同名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" lay-verify="required" value="{{$contract->name}}"  autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">分配客户</label>
                <div class="layui-input-inline">
                    <select name="customer_id">
                        <option value="{{$contract->customer_id}}">{{$contract->customer_id}}</option>
                        <optgroup label="客户">
                            @foreach($customers as $user)
                                <option value="{{$user->id}}">{{$user->id}}</option>
                            @endforeach
                        </optgroup>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">分配商机</label>
                <div class="layui-input-inline">
                    <select name="business_id">
                        <option value="{{$contract->business_id}}">{{$contract->business_id}}</option>
                        <optgroup label="商机">
                            @foreach($business as $user)
                                <option value="{{$user->id}}">{{$user->name}}</option>
                            @endforeach
                        </optgroup>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">分配用户</label>
                <div class="layui-input-inline">
                    <select name="user_id">
                        <option value="{{$contract->user_id}}">{{$contract->user_id}}</option>
                        <optgroup label="员工">
                            @foreach($users as $user)
                                <option value="{{$user->id}}">{{$user->name}}</option>
                            @endforeach
                        </optgroup>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">商机金额</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" lay-verify="required" value="{{$contract->money}}"  name="money" placeholder="￥" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">请选择时间区间</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input"  value="{{$contract->start_time.' 到 '.$contract->end_time}}" name="datetime" id="test16" placeholder="开始 到 结束">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <script>

    </script>
@endsection
